Skip to content

Pin numpy<2 in test_stable min-req job for torch <2.4#3310

Closed
saitcakmak wants to merge 2 commits into
mainfrom
fix-test-stable-numpy-pin
Closed

Pin numpy<2 in test_stable min-req job for torch <2.4#3310
saitcakmak wants to merge 2 commits into
mainfrom
fix-test-stable-numpy-pin

Conversation

@saitcakmak
Copy link
Copy Markdown
Contributor

The min-req job pins torch to the floor declared in pyproject.toml (2.2), but lets pip resolve numpy unconstrained, which picks up numpy 2.x. Torch <2.4 was built against the numpy 1.x C ABI and fails at import time with "numpy not available" when paired with numpy 2.x. Constrain numpy<2 on the Python 3.11 leg, matching the existing pattern used to override the torch floor on the Python 3.14 leg (which uses torch 2.9 and supports numpy 2.x).

Before:
https://github.com/meta-pytorch/botorch/actions/runs/26538884146/job/78174986399 fails with Numpy not available.

After:
https://github.com/meta-pytorch/botorch/actions/runs/26543116588

The min-req job pins torch to the floor declared in pyproject.toml (2.2),
but lets pip resolve numpy unconstrained, which picks up numpy 2.x. Torch
<2.4 was built against the numpy 1.x C ABI and fails at import time with
"numpy not available" when paired with numpy 2.x. Constrain numpy<2 on the
Python 3.11 leg, matching the existing pattern used to override the torch
floor on the Python 3.14 leg (which uses torch 2.9 and supports numpy 2.x).
@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label May 27, 2026
The first install pinned numpy<2 alongside torch 2.2, but the second
'uv pip install .[test]' re-resolved with no numpy cap and upgraded numpy
to 2.x, re-introducing the ABI mismatch. Thread the same constraint
through both install commands.
@saitcakmak saitcakmak closed this May 27, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.98%. Comparing base (e533cd3) to head (02feb0d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3310   +/-   ##
=======================================
  Coverage   99.98%   99.98%           
=======================================
  Files         226      226           
  Lines       22470    22470           
=======================================
  Hits        22466    22466           
  Misses          4        4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant